
/****************************************************************************
*						CSocketCommunication Class header					*
*    				Copyright (C) 2012  J.R. Ruiz-Sarmiento					*
*																			*
*    This program is free software: you can redistribute it and/or modify	*
*    it under the terms of the GNU General Public License as published by	*
*    the Free Software Foundation, either version 3 of the License, or		*
*    (at your option) any later version.									*
*																			*
*    This program is distributed in the hope that it will be useful,		*
*    but WITHOUT ANY WARRANTY; without even the implied warranty of			*
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the			*
*    GNU General Public License for more details.							*
*																			*
*    You should have received a copy of the GNU General Public License		*
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.	*
*																			*
****************************************************************************/

#ifndef _SORT_SEREPDATAEXCHANGER_
#define _SORT_SEREPDATAEXCHANGER_

#include "CSocketCommunication.h"
#include <mrpt/utils.h>
#include "Models.h"

namespace SORT
{
namespace DataIO
{
	class CSEREPDataExchanger
	{
	private:
		SORT::DataIO::CSocketCommunication m_coms;

		#define FIELD_SEPARATOR	","
		#define ELEMENT_SEPARATOR	"|"

		#define ADD_INSTANCES "ADD_INSTANCES" 
		#define GET_CLASSIFICATION_RESULTS "GET_CLASSIFICATION_RESULTS"

	public:

		CSEREPDataExchanger();

		~CSEREPDataExchanger(){};

		void addInstances( mrpt::aligned_containers<SORT::ObjectRecognition::CPlane>::vector_t &v_planes );
		void getClassificationResults( std::string &res );

	private:
		bool receive(string &response); 
		bool transmit(string &response);
	};
}
}
#endif